Add gdk_surface_get_parent back
authorMatthias Clasen <mclasen@redhat.com>
Thu, 2 May 2019 21:43:38 +0000 (17:43 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 28 May 2019 20:25:15 +0000 (20:25 +0000)
The api is the same, the parent is different.
This now returns the parent of popup surfaces.

docs/reference/gdk/gdk4-sections.txt
gdk/gdksurface.c
gdk/gdksurface.h

index e7ff165ecc9cb72c566a7bb75ddd4a2a95299889..2faede76a776d3ef953c8f96aae8c975a157efe4 100644 (file)
@@ -181,6 +181,7 @@ GdkSurfaceState
 gdk_surface_new_toplevel
 gdk_surface_new_temp
 gdk_surface_new_popup
+gdk_surface_get_parent
 gdk_surface_destroy
 gdk_surface_get_surface_type
 gdk_surface_get_display
index 849bea1a674a158badd7503f09aef8682a513c68..651896b34babaf4057046f4d62d162a717b57f48 100644 (file)
@@ -800,6 +800,26 @@ gdk_surface_new_popup (GdkDisplay *display,
   return surface;
 }
 
+/**
+ * gdk_surface_get_parent:
+ * @surface: a #GtkSurface
+ *
+ * Returns the parent surface of a surface, or
+ * %NULL if the surface does not have a parent.
+ *
+ * Only popup surfaces have parents.
+ *
+ * Returns: (transfer none) (nullable): the parent of
+ *   @surface, or %NULL
+ */
+GdkSurface *
+gdk_surface_get_parent (GdkSurface *surface)
+{
+  g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL);
+  
+  return surface->parent;
+}
+
 static void
 update_pointer_info_foreach (GdkDisplay           *display,
                              GdkDevice            *device,
index 45705fb51a1cd1401d458c14702985c241da5c43..4bc98b6193f53251f937f5592a0884ca23342cca 100644 (file)
@@ -436,6 +436,9 @@ GdkSurfaceType gdk_surface_get_surface_type     (GdkSurface     *surface);
 GDK_AVAILABLE_IN_ALL
 gboolean      gdk_surface_is_destroyed          (GdkSurface     *surface);
 
+GDK_AVAILABLE_IN_ALL
+GdkSurface *  gdk_surface_get_parent            (GdkSurface     *surface);
+
 GDK_AVAILABLE_IN_ALL
 GdkDisplay *  gdk_surface_get_display           (GdkSurface     *surface);
 GDK_AVAILABLE_IN_ALL